package com.gong.DesignPattern.SingletonPattern.lanhanShi;

/**
 * @author GongChang
 * @version 1.0
 * @date 2021/6/7 0007 9:12
 */
public class Singleton {

    private static Singleton singleton;

    private Singleton(){

    }

    public static Singleton getInstance(){
        if (singleton == null){
            synchronized (Singleton.class){
                if (singleton == null){
                    return new Singleton();
                }
            }
        }
        return singleton;
    }
}
